using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using PetaPoco;

namespace BlazorAdmin.Models
{
	[PrimaryKey("ID")]
	[TableName($"{nameof(Setting)}s")]
	public class Setting
	{
        /// <summary>
        /// 主键
        /// </summary>
		[NotNull]
		[DisplayName("主键")]
		public int ID { get; set; }

        /// <summary>
        /// 获取或设置 参数 Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("参数")]
		[MaxLength(50, ErrorMessage = "{0}不能超过 50 个字符")]
		public string? Code { get; set; }

        /// <summary>
        /// 获取或设置 参数描述 Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("参数描述")]
		[MaxLength(100, ErrorMessage = "{0}不能超过 100 个字符")]
		public string? Description { get; set; }

        /// <summary>
        /// 获取或设置 参数值 Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("参数值")]
		[MaxLength(1000, ErrorMessage = "{0}不能超过 1000 个字符")]
		public string? Value { get; set; }

		/// <summary>
		/// 获取或设置 是否启用 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("是否启用")]
		public bool? IsEnable { get; set; } = true;

		/// <summary>
		/// 获取或设置 是否只读 Allow Null
		/// </summary>
		[AllowNull]
		[DisplayName("是否只读")]
		public bool? IsReadOnly { get; set; }

        /// <summary>
        /// 获取或设置 更新人 Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("更新人")]
		[MaxLength(30, ErrorMessage = "{0}不能超过 30 个字符")]
		public string? Updater { get; set; }

        /// <summary>
        /// 获取或设置 更新时间 Allow Null
        /// </summary>
		[AllowNull]
		[DisplayName("更新时间")]
		public DateTime? UpdateTime { get; set; }

        #region 添加的成员

        #endregion
	}
}
